]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Use inhibit-unfocus API to keep wayland focus while hidden
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 7 Oct 2019 13:02:17 +0000 (15:02 +0200)
committerverdre <jonas@dressler.it>
Mon, 24 Feb 2020 10:31:08 +0000 (10:31 +0000)
Since commit mutter/a2a8f0cda we force the focus surface of the
meta-wayland-pointer to NULL while the pointer is hidden. This
introduced an issue with the magnifier, where we use
`set_pointer_visible` to hide the real cursor and show our own cursor at
the correct position: Because the meta-wayland-pointer is still used to
communicate with Wayland clients, the UI of the windows will not respond
to mouse movement anymore as soon as the real cursor is hidden.

To fix this, use the newly added clutter_seat_inhibit_unfocus() API to
temporarily disable unsetting the focus-surface while the magnifier is
hiding the system cursor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/993

js/ui/magnifier.js

index 8e149a130ed95af107c6c11ae7f1f7bc12412591..1c935b9c93052c497af9bb3a211ecf7896853c51 100644 (file)
@@ -127,6 +127,10 @@ var Magnifier = class Magnifier {
      * Show the system mouse pointer.
      */
     showSystemCursor() {
+        const seat = Clutter.get_default_backend().get_default_seat();
+
+        if (seat.is_unfocus_inhibited())
+            seat.uninhibit_unfocus();
         this._cursorTracker.set_pointer_visible(true);
     }
 
@@ -135,6 +139,10 @@ var Magnifier = class Magnifier {
      * Hide the system mouse pointer.
      */
     hideSystemCursor() {
+        const seat = Clutter.get_default_backend().get_default_seat();
+
+        if (!seat.is_unfocus_inhibited())
+            seat.inhibit_unfocus();
         this._cursorTracker.set_pointer_visible(false);
     }